﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="Shop.aspx.cs" Inherits="MallInteractiveMap.CMSWebClient.BasicView.Shop" %>
<%@ Import Namespace="MallInteractiveMap.Language" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="../Scripts/jquery.MultiFile.pack.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td>
                <div class="entryDiv">
                    <fieldset>
                        <legend><%= LanguageLoader.GetText("SHOP_INFORMATION")%></legend>
                        <table  class="contentMainTable, cellSpacing, entryDiv"
                            border="0">
                            <tr>
                                <td class="labelCell">
                                    <asp:Label ID="ShopTitleLable" runat="server" Text="Title" AssociatedControlID="ShopTitle" />
                                </td>
                                <td>
                                    <asp:TextBox runat="server" ID="ShopTitle" MaxLength="100" CssClass="textEntry" />
                                    <asp:RequiredFieldValidator ID="ShopTitleRequired" runat="server" ControlToValidate="ShopTitle"
                                        CssClass="failureNotification" ErrorMessage="Title is required." Text="*" SetFocusOnError="true"
                                        ToolTip="Title is required." ValidationGroup="ShopValidationGroup"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="labelCell">
                                    <asp:Label ID="CategoryLabel" runat="server" Text="Category" AssociatedControlID="Category" />
                                </td>
                                <td>
                                    <asp:DropDownList runat="server" ID="Category" Width="320px" />
                                    <asp:RequiredFieldValidator ID="CategoryRequired" runat="server" ControlToValidate="Category"
                                        CssClass="failureNotification" ErrorMessage="Select a Category." Text="*" SetFocusOnError="true"
                                        InitialValue="-1" ToolTip="select a Category." ValidationGroup="FloorValidationGroup"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="labelCell">
                                    <asp:Label ID="FloorLabel" runat="server" Text="Floor" AssociatedControlID="Floor" />
                                </td>
                                <td>
                                    <asp:DropDownList runat="server" ID="Floor" Width="320px" Enabled="false" />
                                    <asp:RequiredFieldValidator ID="FloorRequired" runat="server" ControlToValidate="Floor"
                                        CssClass="failureNotification" ErrorMessage="Select a Floor." Text="*" SetFocusOnError="true"
                                        InitialValue="-1" ToolTip="select a Floor." ValidationGroup="FloorValidationGroup"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="labelCell">
                                    <asp:Label ID="ShopNoLable" runat="server" Text="Shop Number" AssociatedControlID="ShopNo" />
                                </td>
                                <td>
                                    <asp:TextBox runat="server" MaxLength="50" ID="ShopNo" CssClass="textEntry" Enabled="false" />
                                    <asp:RequiredFieldValidator ID="ShopNoRequired" runat="server" ControlToValidate="ShopNo"
                                        CssClass="failureNotification" ErrorMessage="Shop number is required." Text="*"
                                        SetFocusOnError="true" ToolTip="Shop number is required." ValidationGroup="ShopValidationGroup"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="labelCell">
                                    <asp:Label ID="LocationLabel" runat="server" Text="Location" AssociatedControlID="Location" />
                                </td>
                                <td>
                                    <asp:TextBox runat="server" ID="Location" MaxLength="100" CssClass="textEntry" />
                                </td>
                            </tr>
                            <tr>
                                <td class="labelCell">
                                    <asp:Label ID="TelephoneLable" runat="server" Text="Telephone" AssociatedControlID="Telephone" />
                                </td>
                                <td>
                                    <asp:TextBox runat="server" ID="Telephone" MaxLength="50" CssClass="textEntry" />
                                </td>
                            </tr>
                            <tr>
                                <td class="labelCell">
                                    <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">E-mail:</asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="Email" runat="server" MaxLength="50" CssClass="textEntry"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email"
                                        CssClass="failureNotification" ErrorMessage="Email is required." Text="*" SetFocusOnError="true"
                                        ToolTip="Email is required." ValidationGroup="ShopValidationGroup"></asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator runat="server" ID="revEmail" ControlToValidate="Email"
                                        ErrorMessage="Enter a valid email address." ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                        SetFocusOnError="true" Text="*" ValidationGroup="ShopValidationGroup" ToolTip="Enter a valid email address."
                                        CssClass="failureNotification" />
                                </td>
                            </tr>
                            <tr>
                                <td class="labelCell">
                                    <asp:Label ID="FaxLabel" runat="server" Text="Fax" AssociatedControlID="Fax" />
                                </td>
                                <td>
                                    <asp:TextBox runat="server" ID="Fax" MaxLength="50" CssClass="textEntry" />
                                </td>
                            </tr>
                            <tr>
                                <td class="labelCell">
                                    <asp:Label ID="ContactPersonLabel" runat="server" Text="Contact Person" AssociatedControlID="ContactPerson" />
                                </td>
                                <td>
                                    <asp:TextBox runat="server" ID="ContactPerson" MaxLength="100" CssClass="textEntry" />
                                </td>
                            </tr>
                            <tr>
                                <td class="labelCell">
                                    <asp:Label ID="DescriptionLable" runat="server" Text="Description" AssociatedControlID="Description" />
                                </td>
                                <td>
                                    <asp:TextBox runat="server" ID="Description" TextMode="MultiLine" Rows="3" CssClass="textEntryMultiline" />
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                </div>
            </td>
            <td align="left" valign="top" style="width: 40%;">
                <div style=" max-height:400px;">
                    <fieldset>
                        <legend><%= LanguageLoader.GetText("PHOTO_INFORMATION")%></legend>
                        <asp:Repeater runat="server" ID="rptPhoto" OnItemCreated="rptPhoto_ItemCreated">
                            <HeaderTemplate>
                                <table cellpadding="0" cellspacing="2" width="100%">
                            </HeaderTemplate>
                            <ItemTemplate>
                                <tr>
                                    <td>
                                        <a href="#" onclick="ShowPhoto('<%#DataBinder.Eval(Container.DataItem, "Id")%>')">
                                            <%#DataBinder.Eval(Container.DataItem, "FileName")%>
                                        </a>
                                        <%--<asp:LinkButton runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "FileName")%>'
                                            CommandArgument='<%#DataBinder.Eval(Container.DataItem, "Id")%>'></asp:LinkButton>--%>
                                    </td>
                                    <td>
                                        <asp:ImageButton ID="imgRemove" runat="server" ImageUrl="~/images/cross.jpg" Width="16px"
                                            Height="16px" CommandArgument='<%#DataBinder.Eval(Container.DataItem, "Id")%>'>
                                        </asp:ImageButton>
                                    </td>
                                </tr>
                            </ItemTemplate>
                            <FooterTemplate>
                                </table>
                            </FooterTemplate>
                        </asp:Repeater>
                        <asp:Panel runat="server" ID="pnlPhotoUpload">
                            <h4>
                                <%= LanguageLoader.GetText("UPLOAD_PHOTOES")%></h4>
                            <input type="file" class="multi" runat="server" id="fuPhotos" clientidmode="Static" />
                            <script type="text/javascript" language="javascript">
                                $("#fuPhotos").MultiFile();
                            </script>
                        </asp:Panel>
                    </fieldset>
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <p class="saveButton">
                    <asp:Button ID="SaveShop" runat="server" Text="Save" Width="80px" ValidationGroup="ShopValidationGroup"
                        OnClick="Save_Click" />
                    <asp:HyperLink Text="Cancel" runat="server" ID="lnkCancel" NavigateUrl="~/BasicView/ShopDetail.aspx" />
                </p>
            </td>
        </tr>
    </table>
    <script language="javascript" type="text/javascript">
        function ShowPhoto(id) {
            var answer = window.showModalDialog("PhotoViewer.htm?Id=" + id, '', "unadorned:0;scroll:0;center:1;status:0;resizable:0;help:0;dialogWidth:400px;dialogHeight:400px;");
        }

    </script>
</asp:Content>
